load("@build_bazel_rules_android//android:rules.bzl", "android_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])

java_library(
    name = "tink_config",
    srcs = ["TinkConfig.java"],
    deps = [
        "//proto:config_java_proto",
        "//src/main/java/com/google/crypto/tink/daead:deterministic_aead_config",
        "//src/main/java/com/google/crypto/tink/hybrid:hybrid_config",
        "//src/main/java/com/google/crypto/tink/prf:prf_config",
        "//src/main/java/com/google/crypto/tink/signature:signature_config",
        "//src/main/java/com/google/crypto/tink/streamingaead:streaming_aead_config",
    ],
)

android_library(
    name = "tink_config-android",
    srcs = ["TinkConfig.java"],
    deps = [
        "//proto:config_java_proto_lite",
        "//src/main/java/com/google/crypto/tink/daead:deterministic_aead_config-android",
        "//src/main/java/com/google/crypto/tink/hybrid:hybrid_config-android",
        "//src/main/java/com/google/crypto/tink/prf:prf_config-android",
        "//src/main/java/com/google/crypto/tink/signature:signature_config-android",
        "//src/main/java/com/google/crypto/tink/streamingaead:streaming_aead_config-android",
    ],
)

bool_flag(
    name = "use_only_fips",
    build_setting_default = False,
)

config_setting(
    name = "fips_enabled",
    flag_values = {":use_only_fips": "True"},
    visibility = ["//visibility:public"],
)

java_library(
    name = "tink_fips",
    srcs = ["TinkFips.java"],
    visibility = ["//visibility:public"],
    deps = [
        "//src/main/java/com/google/crypto/tink:registry",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util",
    ],
)

android_library(
    name = "tink_fips-android",
    srcs = ["TinkFips.java"],
    visibility = ["//visibility:public"],
    deps = [
        "//src/main/java/com/google/crypto/tink:registry-android",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util-android",
    ],
)
